home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #43 (Apr 89) / Designer CDEF Code / InitTheMenus.Pas < prev    next >
Pascal/Delphi Source File  |  1988-12-27  |  1KB  |  39 lines

  1. UNIT InitTheMenus;
  2.  
  3. INTERFACE
  4.  
  5.     PROCEDURE Init_My_Menus;              {Initialize the menus}
  6.  
  7.     VAR
  8.         AppleMenu : MenuHandle;               {Used to handle DAs, needed for later use}
  9.  
  10.  
  11. IMPLEMENTATION
  12.  
  13.     PROCEDURE Init_My_Menus;              {Initialize the menus}
  14.         CONST
  15.             Menu1 = 201;                        {Menu resource ID}
  16.             Menu2 = 202;                        {Menu resource ID}
  17.         VAR
  18.             tempMenu : MenuHandle;                {Throw away all other menu handles}
  19.  
  20.  
  21.     BEGIN                                 {Start of Init_My_Menus}
  22.         ClearMenuBar;                       {Clear any old menu bars}
  23.  
  24.  
  25.     { This menu is the APPLE menu, used for About and desk accessories.}
  26.         tempMenu := GetMenu(Menu1);         {Get the menu from the resource file}
  27.         AddResMenu(tempMenu, 'DRVR');        {Add in DAs}
  28.         InsertMenu(tempMenu, 0);            {Insert this menu into the menu bar}
  29.         AppleMenu := tempMenu;                {Save this menu handle for later use}
  30.  
  31.     { This menu is  File  }
  32.         tempMenu := GetMenu(Menu2);         {Get the menu from the resource file}
  33.         InsertMenu(tempMenu, 0);            {Insert this menu into the menu bar}
  34.  
  35.         DrawMenuBar;                        {Draw the menu bar}
  36.  
  37.     END;                                    {End of procedure Init_My_Menus}
  38.  
  39. END.